package com.xiaochong.tir.apiservice.scheduled;

import com.xc.logclient.utils.LogTrace;
import com.xiaochong.tir.apiservice.config.ExecutorConfig;
import com.xiaochong.tir.apiservice.service.CmcMarketService;
import com.xiaochong.tir.common.data.po.CurrencyInfo;
import com.xiaochong.tir.common.util.LogTraceKeysUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description: 大盘强弱定时
 * @Author: org
 * @CreateDate: 2018/9/13 16:49
 */@Component

public class CmcMarketScheduled {

     @Autowired
     private CmcMarketService cmcMarketService;

    @Async(ExecutorConfig.SCHEDULER_EXECUTOR_POOL)
    @Scheduled(cron = "0/15 * * * * ? ")
    public void getMarketAnalysisTotalResult(){
        LogTrace.beginTrace("大盘强弱定时");
        cmcMarketService.getMarketAnalysisTotalResult();
        LogTrace.info("大盘强弱定时", "大盘强弱定时", "大盘强弱定时定时执行完成");
        LogTrace.endTrace();
    }

    @Async(ExecutorConfig.SCHEDULER_EXECUTOR_POOL)
    @Scheduled(cron = "0 0/1 * * * ? ")
    public void indexGlobal(){
        LogTrace.beginTrace("大盘指数");
        cmcMarketService.indexGlobal();
        LogTrace.info("大盘指数", "大盘指数", "大盘指数定时定时执行完成");
        LogTrace.endTrace();
    }
}
